import axios from '@/utils/axios';

//任务中心列表数据
export const taskList = (page,pageSize,data) => {
    return axios({
      url: `/task/list/${page}/${pageSize}`,
      method: 'post',
      data
    })
}
//任务类型数据
export const comboBoxData = (dictId) => {
  return axios({
    url: `/base/dict/comboBoxData/${dictId}`,
    method: 'get'
  })
}
//暂存新增 /task
export const taskAdd = (data) => {
  return axios({
     url: `/task`,
    method: 'post',
    data
  })
}
//暂存修改
export const taskUpdata = (data) => {
  return axios({
    url: `/task`,
    method: 'put',
    data
  })
}
//修改获取详情
export const getTaskData = (taskId) => {
  return axios({
    url: `/task/${taskId}`,
    method: 'get'
  })
}
//删除任务 /task/{taskId}
export const taskDel = (taskId) => {
  return axios({
    url: `/task/${taskId}`,
    method: 'delete'
  })
}

// 发布接口/task/taskStatus/{taskId}/{taskStatus}
export const taskStatus = (taskId,status) => {
  return axios({
    url: `/task/taskStatus/${taskId}/${status}`,
    method: 'put'
  })
}
// 办理接口/task/taskStatus/{taskId}/{taskStatus}
export const acceptingStatus = (taskId,acceptingStatus) => {
  return axios({
    url: `/task/acceptingStatus/${taskId}/${acceptingStatus}`,
    method: 'put'
  })
}
//获取文件列表 /attachment/findAttchList/{page}/{size}
export const findAttchList = (data) => {
  return axios({
      url: '/attachment/findAttchList/0/0',
      method: 'post',
      data
  })
}
//下载文件
export const download = (data) => {
  return axios({
      url: '/attachment/download',
      method: 'post',
      data
  })
}
//任务反馈列表
export const taskFeedback = (taskId) => {
  return axios({
    url: `/task/taskFeedback/findList/${taskId}/0/0`,
    method: 'get'
  })
}
//新增反馈内容
export const taskFeedbackAdd = (data) => {
  return axios({
      url: '/task/taskFeedback',
      method: 'post',
      data
  })
}
//修改反馈内容
export const taskFeedbackUpdata = (data) => {
  return axios({
      url: '/task/taskFeedback',
      method: 'put',
      data
  })
}
//反馈详情
export const getTaskFeedback = (feedbackId) => {
  return axios({
      url: `/task/taskFeedback/${feedbackId}`,
      method: 'get'
  })
}
//提交任务反馈
export const taskFeedbackSubmit = (feedbackId) => {
  return axios({
      url: `/task/taskFeedback/${feedbackId}`,
      method: 'put'
  })
}
//删除任务反馈
export const taskFeedbackDel = (feedbackId) => {
  return axios({
      url: `/task/taskFeedback/${feedbackId}`,
      method: 'delete'
  })
}
//完成结果列表
export const taskResult = (taskId) => {
  return axios({
    url: `/task/taskResult/${taskId}/0/0`,
    method: 'get'
  })
}
// 新增完成结果
export const taskResultAdd = (data) => {
  return axios({
    url: `/task/taskResult`,
    method: 'post',
    data
  })
}
// 修改完成结果
export const taskResultUpdata = (data) => {
  return axios({
    url: `/task/taskResult`,
    method: 'put',
    data
  })
}
// 获取完成结果详情
export const getTaskResult = (resultId) => {
  return axios({
    url: `/task/taskResult/${resultId}`,
    method: 'get'
  })
}
// 提交完成结果
export const taskResultSubmit = (resultId) => {
  return axios({
    url: `/task/taskResult/${resultId}`,
    method: 'put'
  })
}
// 删除完成结果
export const taskResultDel = (resultId) => {
  return axios({
    url: `/task/taskResult/${resultId}`,
    method: 'delete'
  })
}

/* 附件删除 */
export const removeFiles=(data)=>{
  return axios({
    url:`/attachment/delete/${data}`,
    method:'delete'
  })
}
